
<?php

$dbhost = "mysql.groovemechanic.net";
$dbuser = "oproto_user";
$dbpass = "oproto12345";
$dbname = "groovemechanic_oproto";

$con = mysql_connect ($dbhost, $dbuser, $dbpass) or die(mysql_error());
mysql_select_db ($dbname) or die (mysql_error());

$uuid = $_POST['doc_uuid'];

$query = "SELECT * FROM comments WHERE document_id='$uuid'";
$result = mysql_query($query);

$numRows=mysql_numrows($result);

for ($i=0; $i<$numRows; $i++) {

	echo 
		"<div class='comment_row'>
			<div class='comment_from'>".mysql_result($result, $i, "from")."</div>
			<div class='comment_date'>".mysql_result($result, $i, "date")."</div>
			<div class='comment_text'>".mysql_result($result, $i, "comment")."</div>
		</div>";

}

mysql_close($con);

?>
